 <!DOCTYPE html>
 <html lang="en"> 
<!-- BEGIN HEAD -->
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<head>
    <%@include file="../../template/estilos_login.jsp"%>
    <%@include file="../../template/script_login.jsp"%>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="login">
	<!-- BEGIN LOGO -->
	<div class="logo">
		<img src="${pageContext.request.contextPath}/resources/assets/img/logo-big.png" alt="" /> 
	</div>
	<!-- END LOGO -->
	<!-- BEGIN LOGIN -->
	<div class="content">
		<!-- BEGIN LOGIN FORM -->
                 <!-- name="userName" id="userName"
                <form method="post">class="form-vertical login-form"
                 <input type="text" path="UserName" placeholder="Usuario" name="UserName" id="UserName"/>
                 -->
                 <!--
                
                 -->
                 <form:form action="/GedeonMvc/login/login" class="form-vertical login-form" commandName="systemUser"   method="post">
                          
			<h3 class="form-title">Login to your account  
                             
                        </h3>
			<div class="alert alert-error hide">
                           
				<button class="close" data-dismiss="alert"></button>
				<span>Ingrese el Usuario y Contraseña.</span>
			</div>
                   
                                
                                 
			<div class="control-group">
                            ${mensaje}   
                               
                                         
				<!--ie8, ie9 does not support html5 placeholder, so we just show field title for that-->
				<label class="control-label visible-ie8 visible-ie9">Usuario</label>
				<div class="controls">
					<div class="input-icon left">
                                          
<% 
                      Cookie cookie = null;
                      Cookie[] cookies = null; 
                        // Get an array of Cookies associated with this domain
                      cookies = request.getCookies();
   
                      if( cookies != null ){ 
                        for (int i = 0; i < cookies.length; i++){
          
                            cookie = cookies[i]; 
                          if(cookie.getName().equals("billing")){
                             if(cookie.getValue() != null && !cookie.getValue().equals("") ){
                                response.sendRedirect("login/cookie?s="+cookie.getValue());
                                  
                             }
                                
                           } 
                        }
                     }  
                      session.invalidate(); 
%>
                                              
                                             <form:hidden value="${pageContext.session.id}" path="sessionId"></form:hidden> 
						<i class="icon-user"></i>
                                                <form:input path="userName" placeholder="Usuario" ></form:input>
                                                <% String ipCustom = request.getRemoteAddr(); %>
                                                <form:hidden path="ipComputer" value="<%= ipCustom %>"></form:hidden>
						  
					</div>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label visible-ie8 visible-ie9">Contraseña</label>
				<div class="controls">
					<div class="input-icon left">
						<i class="icon-lock"></i>
                                        <form:password path="password" class="m-wrap placeholder-no-fix"  placeholder="Contraseña"></form:password>
						 
					</div>
				</div>
			</div>
			<div class="form-actions">
                         
				<label class="checkbox">
				<input type="checkbox" name="closedSession" checked value="1"/> No cerrar sesi&oacute;n
				</label>
				<button type="submit" class="btn green pull-right">
				Ingresar <i class="m-icon-swapright m-icon-white"></i>
				</button>         
                  
			</div>
			<div class="forget-password">
				<h4>¿Olvidates tu Contraseña ?</h4>
				<p>
					No te preocupes, click <a href="javascript:;" class="" id="forget-password">aqui</a>
					para recuperar tu contraseña.
				</p>
			</div>
			</form:form>
                        <!--
		</form>
                        --> 
		<!-- END LOGIN FORM -->        
		<!-- BEGIN FORGOT PASSWORD FORM -->
		<form class="form-vertical forget-form" action="index">
			<h3 class="">¿Olvidastes tu Contraseña?</h3>
			<p>Ingresa tu correo electronico para recuperar tu contraseña.</p>
			<div class="control-group">
				<div class="controls">
					<div class="input-icon left">
						<i class="icon-envelope"></i>
						<input class="m-wrap placeholder-no-fix" type="text" placeholder="Email" name="email" />
					</div>
				</div>
			</div>
			<div class="form-actions">
				<button type="button" id="back-btn" class="btn">
				<i class="m-icon-swapleft"></i> Atras
				</button>
				<button type="submit" class="btn green pull-right">
				Enviar <i class="m-icon-swapright m-icon-white"></i>
				</button>            
			</div>
		</form>
		<!-- END FORGOT PASSWORD FORM -->
		<!-- BEGIN REGISTRATION FORM -->
		
	</div>
	<!-- END LOGIN -->
	<!-- BEGIN COPYRIGHT -->
	<div class="copyright"> 
                <font color="white">
                © 2000-2013 
                </font>
                <a href="http://www.tesam.com" target="_blank">
                 <font color="white">   TE.SA.M PERU S.A. </font>
                </a>
                 
	</div>
             
</body> 
<!-- END BODY -->
 
</html>


